package org.kotboot.enums;

import org.kotboot.kit.K;

/**
 * Created by jisong.sun on 2017/9/21.
 */
public enum ESkuState implements CodeEnum<ESkuState> {
    UP(1,"上架")
    ,DOWN(10,"下架");

    private int code;
    private String title;

    ESkuState(int code,String title){
        this.code = code;
        this.title = title;
    }

    public static ESkuState of(String title){
        if(K.isEmpty(title)) return null;
        for(ESkuState s:ESkuState.values()){
            if(s.title.equals(title))
                return s;
        }
        return null;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String toString() {
        return title;
    }
}
